package com.webex.ta.hydra.core;

import com.webex.ta.hydra.exceptions.InvalidVariableException;
import com.webex.ta.hydra.function.CompoundVariable;

/**
 * Created by Cisco WebEx.
 * User: vegaz
 * Date: 2010-8-30
 * Time: 9:32:54
 */
public class HydraParameter {
    private CompoundVariable expression;

    public HydraParameter() {
        this("");
    }

    public HydraParameter(String expr) {
        expression = new CompoundVariable();
        try {
            expression.setParameter(expr);
        } catch (InvalidVariableException e) {

        }
    }

    public String getExpression() {
        return expression.getRaw();
    }

    public String getStringValue() {
        return expression.execute();
    }

    public Integer getIntegerValue() {
        return Integer.valueOf(this.getStringValue());
    }
}
